<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
	<input type="text" v-model.lazy="text">
	<span>{{tip}}</span>
	</div>

	
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
				text:'',tip:''
            },methods: {
				handle:function(newVal){
					setTimeout(()=>{
						if(newVal=='admin'){
						this.tip='该用户已存在'
						}else{
						this.tip="验证成功!!!"
						}
					},1000)
				}
			},watch:{
				text:function(newVal){
				this.handle(newVal)
					this.tip='数据验证中....'
				}
			}
			
        })
    </script>
</body>

</html>